﻿@{
    ViewBag.Title = "Login";
    Layout = "~/Views/Shared/_Main.cshtml";
}
<div class="content">
    <div class="container">
        <div class="register">
            <div class="row">
                <div class="span6">
                    <h2>
                        企业在线新时代</h2>
                    <p class="big grey">
                        企盟在线，不仅仅是企业网站。助力企业在线新时代！</p>
                    <p>
                        企盟在线为您提供便捷的，美观的，高可用性和安全性的免费企业网站解决方案。通过它您可以完全免费的获取您的企业站点，并享受我们提供的优质的企业在线解决方案。
                    </p>
                    <p>
                        未来，我们还将提供企业黄页，企业联盟广告解决方案等。您企业的成长，是我们始终努力的方向。
                    </p>
                </div>
                <div class="span6">
                    <div class="formy">
                        <h5>
                            登录企盟在线</h5>
                        <div class="form">
                            <!-- Login form (not working)-->
                            <form id="loginform" method="post" action="/account/login" class="form-horizontal">
                            <input type="hidden" name="token" />
                            <input type="hidden" name="ReturnUrl" value="@ViewBag.Return" />
                            <!-- Username -->
                            <div class="control-group">
                                <label class="control-label" for="username">
                                    用户名</label>
                                <div class="controls">
                                    <input type="text" class="input-large {required:true,messages:{required:'*'}}" name="userName" id="txtusername" 
                                        value="@ViewBag.UserName" placeholder="请输入登录帐号"/>
                                </div>
                            </div>
                            <!-- Password -->
                            <div class="control-group">
                                <label class="control-label" for="email">
                                    密码</label>
                                <div class="controls">
                                    <input type="password" class="input-large {required:true,messages:{required:'*'}}" name="password" id="txtpassword"
                                        placeholder="请输入帐号密码" />
                                </div>
                            </div>
                            <div class="control-group">
                                <label class="control-label">
                                    验 证</label>
                                <div class="controls">
                                    <div class="span3" style="margin-left:0px;">
                                        <input type="text" id="txtvaildcode" name="validcode"
                                         class="{required:true}"
                                         placeholder="请输入右侧验证码" />
                                    </div>
                                    <div id="codeimg" style="margin-left: 10px; "> 
                   
                                    </div>
                                </div>
                            </div>
                            @if (!String.IsNullOrEmpty(ViewBag.Error))
                            {
                            <div class="control-group">
                                <label class="control-label">
                                    &nbsp;</label>
                                <div class="controls">
                                    <span style="font-weight:bold;" class="badge badge-important">@ViewBag.Error</span>
                                </div>
                            </div>
                            }
                            <!-- Buttons -->
                            <div class="form-actions">
                                <!-- Buttons -->
                                <button type="submit" class="btn btn-warning">
                                    Login</button>
                                <button type="reset" class="btn" style="color:#000;">
                                    Reset</button>
                                &nbsp;&nbsp;<a href="/account/forgotpassword">忘记密码</a>
                            </div>
                            </form>
                            还没有账号? <a href="/account/register">立即注册</a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="border">
        </div>
        @Html.Partial("~/views/shared/partial/_article.cshtml")
    </div>
</div>

@section tail {
    <script type="text/javascript" src="/scripts/plug.js"></script>
    <script type="text/javascript" src="/Scripts/jquery.validate.js"></script>
    <script type="text/javascript" src="/Scripts/jquery.metadata.js"></script>
    <script type="text/javascript">
        var validation = new plug.BindValidCode();
        $(function () {
            validation.BindValidator();
            $('#loginform').validate({
                errorClass: "help-inline",
                errorElement: "span",
                highlight: function (element, errorClass, validClass) {
                    $(element).parents('.control-group').addClass('error');
                },
                unhighlight: function (element, errorClass, validClass) {
                    $(element).parents('.control-group').removeClass('error');
                }
            });
        });
        function Refalsh(sender) {
            validation.Refalsh(sender);
        }
    </script>
}